<!DOCTYPE html>
<html lang="en">
<head>
    <!-- jsp文件头和头部 -->
    <#include '../top.ftl'>
</head>
<script type="text/javascript" src="/static/js/jquery.form.js"></script>
<script>
    var ctx=${base};
</script>
<script type="text/javascript">
    function search() {
        $("#userForm").submit();
    }
    //导出excel
    function toExcel(){
        var USERNAME = $("#USERNAME").val();
        var lastLoginStart = $("#lastLoginStart").val();
        var lastLoginEnd = $("#lastLoginEnd").val();
        var org_id = $("#org_id").val();
        window.location.href="/user/excel.shtml?USERNAME="+USERNAME+"&lastLoginStart="+lastLoginStart+"&lastLoginEnd="+lastLoginEnd+"&org_id="+org_id;
    }
</script>
<body>

<div class="container-fluid" id="main-container">
    <div id="page-content" class="clearfix">
        <div class="row-fluid">
            <div class="row-fluid">
                <!-- 检索  -->
                <form action="/user/UserList.shtml" method="get" name="userForm" id="userForm">
                    <table>
                        <tr>
                            <td>
						<span class="input-icon">
							<input autocomplete="off"  type="text" name="USERNAME" value="" id="USERNAME" placeholder="这里输入关键词" />
							<i id="nav-search-icon" class="icon-search"></i>
						</span>
                            </td>
                            <td><input class="span10 date-picker" name="lastLoginStart" id="lastLoginStart" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="开始日期" title="最近登录开始"/></td>
                            <td><input class="span10 date-picker" name="lastLoginEnd" id="lastLoginEnd"  type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="结束日期" title="最近登录结束"/></td>
                            <td style="vertical-align:top;">
                                <select class="chzn-select" name="org_id" id="org_id" data-placeholder="请选择部门" style="vertical-align:top;width: 120px;">
                                    <option value=""></option>
                                    <option value="">全部</option>
                                    <#list organizations as o>
                                        <option value="${o.id}">${o.org_name }</option>
                                    </#list>
                                </select>
                            </td>
                                <td style="vertical-align:top;"><button class="btn btn-mini btn-light" onclick="search();" title="检索"><i id="nav-search-icon" class="icon-search"></i></button></td>
                                <td style="vertical-align:top;"><a class="btn btn-mini btn-light" onclick="toExcel()" title="导出到EXCEL"><i id="nav-search-icon" class="icon-download-alt"></i></a></td>
                        </tr>
                    </table>
                    <!-- 检索  -->


                    <table id="table_report" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th class="center">
                                <label><input type="checkbox" id="zcheckbox" /><span class="lbl"></span></label>
                            </th>
                            <th>序号</th>
                            <th>字典名称</th>
                            <th>编码</th>
                            <th>级别</th>
                            <th class="center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <#list users as u>
                        <tr>
                            <td class="center"><label><input type="checkbox" name="ids" value="${u. USER_ID}" /><span class="lbl"></span></label></td>
                            <td class='center' style="width: 30px;">${u_index+1}</td>
                            <td>${(u.NUMBER)!}</td>
                            <td>${u.USERNAME}</td>
                            <td class='center'><img src="${u.allUrl}"  onerror="this.src='/static/images/default.jpg'"  class="nav-user-photo"/></td>
                            <td></td>
                            <td>
                                <a class='btn btn-mini btn-info' title="编辑" onclick="editUser('');"><i class='icon-edit'></i></a>

                                <a class='btn btn-mini btn-danger' title="删除" onclick="delUser('','');"><i class='icon-trash'></i></a>
                            </td>
                        </tr>
                        </#list>

                        </tbody>
                    </table>

                    <div class="page-header position-relative">
                        <table style="width:100%;">
                            <tr>
                                <td style="vertical-align:top;">
                                        <a class="btn btn-small btn-success" onclick="add()">新增</a>
                                        <a title="批量发送电子邮件" class="btn btn-small btn-info" onclick="makeAll('确定要给选中的用户发送邮件吗?');"><i class="icon-envelope-alt"></i></a>
                                        <a title="批量删除" class="btn btn-small btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" ><i class='icon-trash'></i></a>
                                </td>
                                <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page}</div></td>
                            </tr>
                        </table>
                    </div>
                </form>
            </div>

            <!-- PAGE CONTENT ENDS HERE -->
        </div><!--/row-->

    </div><!--/#page-content-->
</div><!--/.fluid-container#main-container-->

<!-- 返回顶部  -->
<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse">
    <i class="icon-double-angle-up icon-only"></i>
</a>

<!-- 引入 -->
<script src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/ace.min.js"></script>
<script type="text/javascript" src="/static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
<script type="text/javascript" src="/static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
<script type="text/javascript" src="/static/layer-v2.4/layer/layer.js"></script>
<script type="text/javascript" src="/static/js/project/user/user_list.js"></script>
<script type="text/javascript">
    $(function() {
        //日期框
        $('.date-picker').datepicker();
        //下拉框
        $(".chzn-select").chosen();
        $(".chzn-select-deselect").chosen({allow_single_deselect:true});
    });
</script>

</body>
</html>

